package com.zmn.oms.zmn.business.interfaces.proxy;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.common.exception.chan.ChannelFacadeException;
import com.zmn.oms.model.bo.order.OrderBO;
import com.zmn.oms.model.dto.order.open.AvailableTimeslotsQuery;
import com.zmn.oms.model.dto.order.proxy.*;
import com.zmn.oms.model.entity.order.OrderListQuery;
import com.zmn.oms.model.entity.order.OrderQuery;
import com.zmn.oms.model.vo.order.open.AvailableTimeslotsVO;
import com.zmn.oms.model.vo.order.proxy.OrderInfoVO;

import java.util.List;

/**
 * 类描述：订单代理接口类
 *
 * @author liuying
 * @date 2019/02/18 09:53
 */
public interface ProxyOrderBService {

    /**
     * 查订单数量
     * @param orderListQuery
     * @return
     */
    int orderListCount(OrderListQuery orderListQuery);

    /**
     * 查询订单列表
     *
     * @param orderListQuery
     * @return
     */
    List<OrderInfoVO> orderList(OrderListQuery orderListQuery);

    /**
     * 创建订单
     *
     * @param createOrderDTO
     * @return
     */
    OrderBO createOrder(CreateOrderDTO createOrderDTO) throws OmsBaseException;

    /**
     * 创建订单
     *
     * @param createOrderDTO
     * @return
     */
    OrderBO createOrder(com.zmn.oms.model.dto.order.open.CreateOrderDTO createOrderDTO) throws OmsBaseException;

    /**
     * 修改订单
     *
     * @param updateOrderDTO
     * @return
     */
    void updateOrder(UpdateOrderDTO updateOrderDTO) throws OmsBaseException;

    /**
     * 修改渠道预付款金额
     *
     * @param updateOrderDTO
     * @return
     */
    void updateChannelPrepayAmount(UpdateOrderDTO updateOrderDTO) throws OmsBaseException;

    /**
     * 查询订单详情
     */
    OrderInfoVO queryOrderById(OrderQuery orderQuery) throws OmsBaseException;

    /**
     * 订单支付
     *
     * @param payOrderDTO
     */
    void payOrder(PayOrderDTO payOrderDTO) throws Exception;

    /**
     * 添加日志
     *
     * @param orderLogDTO
     * @return
     */
    void addOrderLog(OrderLogDTO orderLogDTO) throws OmsBaseException;

    /**
     * 取消订单
     *
     * @param cancelOrderDTO
     */
    void cancelOrder(CancelOrderDTO cancelOrderDTO) throws OmsBaseException;

    /**
     * 添加日志
     *
     * @param commentDTO
     * @return
     */
    void addComment(CommentDTO commentDTO) throws OmsBaseException;

    /**
     * 保存渠道二次支付金额信息
     * @param payOrderDTO
     */
    @Deprecated
    void saveChannelSecondPay(PayOrderDTO payOrderDTO) throws Exception;

    /**
     * 修改订单的外部id
     */
    void updateChannelOuterId(OrderQuery orderQuery) throws OmsBaseException;

    /**
     * 查询预约时间
     *
     * @param availableTimeslotsQuery
     * @return
     */
    List<AvailableTimeslotsVO> queryAvailableTimeslots(AvailableTimeslotsQuery availableTimeslotsQuery)
            throws OmsBaseException;

    /**
     * 保存为线索单
     * @param createOrderDTO
     * @param errorMsg
     * @throws ChannelFacadeException
     */
    void saveAsOrderClueDetail(CreateOrderDTO createOrderDTO, String errorMsg) throws ChannelFacadeException;
}
